Imports System.Collections

Public Class NCLDTSJobs
    Inherits CollectionBase

    Public Sub Add(ByVal DTSJobObj As NCLDTSJob)
        If Contains(DTSJobObj) = True Then
            Return
        Else
            List.Add(DTSJobObj)
        End If
    End Sub

    Public Sub Add(ByVal DTSFilePath As String, ByVal DTSFileName As String)
        Dim _oNCLDTSJob As New NCLDTSJob(DTSFilePath, DTSFileName)

        If Contains(_oNCLDTSJob) = True Then
            Return
        Else
            List.Add(_oNCLDTSJob)
        End If
    End Sub

    Default Public ReadOnly Property Item(ByVal Index As Integer) As NCLDTSJob
        Get
            Return CType(List.Item(Index), NCLDTSJob)
        End Get
    End Property

    Public ReadOnly Property Contains(ByVal DTSJobObj As NCLDTSJob) As Boolean
        Get
            Dim _oNCLDTSJob As NCLDTSJob

            For Each _oNCLDTSJob In List
                If DTSJobObj.DTSFileNameWPath = _oNCLDTSJob.DTSFileNameWPath Then
                    Return True
                End If
            Next

            Return False
        End Get
    End Property
End Class

Public Class NCLDTSJob
    Private __sDTSFilePath As String
    Private __sDTSFileName As String

    Public Sub New(ByVal DTSFilePath As String, ByVal DTSFileName As String)
        If Right(DTSFilePath.Trim, 1) = "\" Then
            __sDTSFilePath = DTSFilePath.Trim
        Else
            __sDTSFilePath = DTSFilePath.Trim & "\"
        End If

        __sDTSFileName = DTSFileName.Trim
    End Sub

    Public ReadOnly Property DTSFilePath() As String
        Get
            Return __sDTSFilePath
        End Get
    End Property

    Public ReadOnly Property DTSFileName() As String
        Get
            Return __sDTSFileName
        End Get
    End Property

    Public ReadOnly Property DTSFileNameWPath() As String
        Get
            Return __sDTSFilePath & __sDTSFileName
        End Get
    End Property
End Class
